<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="pragma" content="no-cache">  <!-- HTTP 1.1 -->
    <meta http-equiv="cache-control" content="no-cache,must-revalidate">  <!-- HTTP 1.0 -->
    <meta name="renderer" content="webkit|ie-comp|ie-stand"/> <!--优先级：极速模式，兼容模式，IE模式-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <title>扬州房产测绘业务管理系统</title>
    <link rel="stylesheet" type="text/css" href="../../../libs/jeasyui-181/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../../../libs/jeasyui-181/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="../../../libs/jeasyui-181/themes/color.css">
    <link rel="stylesheet" type="text/css" href="../../../css/common.css">
    <script type="text/javascript" src="../../../libs/jeasyui-181/jquery.min.js"></script>
    <script type="text/javascript" src="../../../libs/jeasyui-181/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../../libs/thUtil.js"></script>
    <script type="text/javascript">

        var mainGrid = new UserContol();

        $(function () {
            if (UrlParm.hasParm('text')) {
                $('h1').html(UrlParm.parm('text'));
            }
            $('#receive_Link').html(button.create).linkbutton({onClick: ajax.receive});
            mygrid.init();
        });

        var ajax = {
            getList: function (param, success) {
                Network.connect(window.api.caseTodoList, 'POST', param, function (res) {
                    if (res.code === ResponseCode.OK) {
                        success(res.data);
                    }
                });
            },
            receive: function () {
                var rows = $('#mainGrid').datagrid("getSelections");
                if (rows.length === 1) {
                    Tools.confirm('是否签收？', function (result) {
                        if (result) {
                            var formData = rows[0];
                            Network.connect(window.api.signFor, 'POST', formData, function (res) {
                                if (res.code === ResponseCode.OK) {
                                    Tools.show("签收成功")
                                    mygrid.reload();
                                }
                            });
                        }
                    });
                }
                else {
                    Tools.alert('请选择需要签收的案件。');
                }
            },
            resort: function () {
                Tools.confirm('是否确定重新整理数据？', function (result) {
                    if (result) {
                        Network.connect(window.api.groupReSort, 'POST', {}, function (res) {
                            if (res.code === ResponseCode.OK) {
                                Tools.show('重新整理成功');
                                mygrid.reload();
                            }
                        });
                    }
                });
            }
        };

        var mygrid = {
            init: function () {
                mainGrid.dataGrid.id = 'mainGrid';
                mainGrid.dataGrid.idField = 'ID';
                //   mainGrid.dataGrid.sortName = 'USERID';
                mainGrid.dataGrid.sortOrder = 'asc';
                mainGrid.dataGrid.toolbar = '#toolbar';
                mainGrid.dataGrid.onLoadSuccess = function (data) {
                    if (data.total === 0)

                        $(".easyui-linkbutton").linkbutton();
                };
                mainGrid.dataGrid.loader = function (param, success, error) {
                    ajax.getList(param, success);
                };
                mainGrid.dataGrid.columns = [[
                    {
                        field: 'd',
                        title: '<img src="../../../libs/jeasyui-181/themes/icons/workflow/normal.gif">',
                        halign: 'center',
                        align: 'center',
                        width: 50,
                        formatter: function () {
//                            return '<li data-options="iconCls:\'icon-ok\'"></li>';
                            return '<img src="../../../libs/jeasyui-181/themes/icons/workflow/normal.gif">';
                        }
                    },
                    {
                        field: 'q',
                        title: '<img src="../../../libs/jeasyui-181/themes/icons/workflow/normal1.gif">',
                        halign: 'center',
                        align: 'center',
                        width: 50,
                        formatter: function () {
                            return '<img src="../../../libs/jeasyui-181/themes/icons/workflow/normal1.gif">';
                        }
                    },
                    {
                        field: 'projectNo',
                        title: '受理号',
                        halign: 'center',
                        align: 'center',
                        width: 100,
                        iconCls: 'icon-cancel'
                    },
                    {field: 'adminAreaName', title: '行政区', halign: 'center', align: 'center', width: 50},
                    {field: 'projectName', title: '项目名称', halign: 'center', align: 'left', width: 300},
                    {field: 'housePosition', title: '幢号', halign: 'center', align: 'center', width: 100},
                    {field: 'createUserName', title: '提交人', halign: 'center', align: 'center', width: 100},
                    {field: 'executorName', title: '待办人', halign: 'center', align: 'center', width: 100},
                    {field: 'receiveDate', title: '到件日期', halign: 'center', align: 'center', width: 200},
                    {field: 'endDate', title: '截止日期', halign: 'center', align: 'center', width: 200},
                    {field: 'processName', title: '流程名称', halign: 'center', align: 'center', width: 150},
                    {field: 'status', title: '环节名称', halign: 'center', align: 'center', width: 100}

                ]];
                mainGrid.InitdataGrid();
            },
            reload: function () {
                $('#mainGrid').datagrid('reload');
            },
            selectRow: function () {
                return $('#mainGrid').datagrid('getSelected');
            }
        };

    </script>

</head>
<body>
<div class="container-wrap">
    <div id="toolbar">
        <div class="container-tit">
            <h1></h1>
        </div>
        <div class="sreach fixed">
            <div class="input-box">
                <select class="easyui-combobox" name="businessType" id="businessType"
                        data-options="  width: 360,
                                            labelWidth: 80,
                                            labelPosition: 'left',
                                            required: true,
                                            label: '业务类型:',
                                            panelHeight: 'auto',
                                            valueField: 'id',
                                            textField: 'text',
                                            editable: false,"></select>
            </div>
            <div class="input-box">
                <select class="easyui-combobox" name="processName" id="processName"
                        data-options="  width: 360,
                                            labelWidth: 80,
                                            labelPosition: 'left',
                                            required: true,
                                            label: '业务环节:',
                                            panelHeight: 'auto',
                                            valueField: 'id',
                                            textField: 'text',
                                            editable: false,"></select>
            </div>
            <a id="search_Link" href="#" class="easyui-linkbutton search">查询</a>
            <br/>
            <div class="input-box" style="width: 370px">
                <input type="text" id="username" name="username" class="easyui-textbox"
                       data-options="label:'受理号:',labelWidth: 80,width:350,"/>
            </div>
            <div class="input-box" style="width: 370px">
                <input type="text" id="userCname" name="userCname" class="easyui-textbox"
                       data-options="label:'业务名称:',labelWidth: 80,width:350,"/>
            </div>
            <a id="reset_Link" href="#" class="easyui-linkbutton default">重置</a>
            <div class="bar-btn" style="position: absolute;bottom: 18px;right: 8px;">
                <a id="receive_Link" href="#" class="easyui-linkbutton insert">签收</a>
                <a id="merged_Link" href="#" class="easyui-linkbutton update">合并</a>
            </div>
        </div>
    </div>
    <div id="mainGrid"></div>
</div>
</body>
</html>